import java.sql.*;
import java.sql.DriverManager;
import java.sql.PreparedStatement;
import java.sql.ResultSet;
import java.util.Scanner;


public class ReadData {

	public static void main(String[] args)throws Exception {
		Class.forName("oracle.jdbc.driver.OracleDriver");
		Connection cn=DriverManager.getConnection("jdbc:oracle:thin:@localhost:1521:xe","system" ,"oracle");
		PreparedStatement ps=cn.prepareStatement("select *from Employee where eno=?");
		
		Scanner scan=new Scanner(System.in);
		System.out.println("employee no:");
		int eno=scan.nextInt();
		
		ps.setInt(1, eno);
		ResultSet rs=ps.executeQuery();
		if(rs.next())
		{
			System.out.println(rs.getInt(1)+":"+rs.getString(2)+":"+rs.getFloat(3));
		}
		else
			System.out.println("Invalid query");
		
		rs.close();
		ps.close();
		cn.close();
	}
		

}
